﻿<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="website_admin_members_memberinfoeditor" Codebehind="memberinfoeditor.aspx.cs" %>

<%@ Register Src="../../admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar"
    TagPrefix="uc1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title></title>

    <script type="text/javascript" src="../_static/_jQuery/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../../admin/_static/_jQuery/jquery_validator.js"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <script language="javascript" src="../_static/_jQuery/jquery-fileupload.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/jquery_json.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/jquery_stringutil.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/interface.js" type="text/javascript"></script>

    <link href="../_common/styles/frame_global.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../../_common/datepicker/wdatepicker.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
    $(document).ready(setup);
    function setup()
    {
        validator.setup("#crmForm"); 
        if(getUrlParam("otype") == "modify")
        {
            LoadRegionList("init", "city", 1);
            LoadRegionList("init", "countie", 2);
            $("#txtPassword").attr("readonly", true);
            $("#txtPassword").val("12345678");
        }
    }
    function Cancel()
    {
        var groupid=getUrlParam("groupid");
        window.location.href="membersmaglist.aspx?groupid="+groupid;
    }
    function LoadRegionList(loadingtype, layername, _layer)
    {
        var _parentid = ""; 
        
        if(layername == "city")
            _parentid = $("#selProvinceList").val();
            
        if(layername == "countie")
            _parentid = $("#selCityList").val();
            
        if(_parentid != "")
	    {           
            if(loadingtype != "init")
            { 
                GetDrpListTextToTargetObj("selProvinceList", "txtRegionInfo"); 
 
                $("#txtProvinceId").val($("#selProvinceList").val());
            }
            
	        $.ajax({
                async   :   false,
                type    :   "POST",
                url     :   "memberinfoeditor.aspx",
                data    :   { otype : "getcitylist", _layername: layername, parentid : _parentid },
                success :   function(data, textStatus) {
                    switch(_layer)
                    {
                        case 1:
                            $("#selCityList").emptySelect().append(data).change(function() {
                                LoadRegionList("event", "countie", 2);
                                $("#txtRegionId").val($("#selCityList").val());
                                $("#txtCityId").val($("#selCityList").val());
                                
                                if($("#selCityList").val() != "0")
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList"));
                                else 
                                    GetDrpListTextToTargetObj("selProvinceList", "txtRegionInfo");
                            });
                            break;
                        case 2:
                            $("#selCountiesList").emptySelect().append(data).change(function() {
                                $("#txtRegionId").val($("#selCountiesList").val());
                                $("#txtCountieId").val($("#selCountiesList").val());
                                
                                if($("#selCountiesList").val() != "0")
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList") + " | " + GetDrpListText("selCountiesList"));
                                else
                                    $("#txtRegionInfo").val(GetDrpListText("selProvinceList") + " | " + GetDrpListText("selCityList"));
                            }); 
                            break;
                    }
                }
            });

            if(loadingtype == "init")
            {
                if($("#txtCountieId").val() != "0")
                    $("#selCountiesList").val($("#txtCountieId").val());
                if($("#txtCityId").val() != "0")
                    $("#selCityList").val($("#txtCityId").val());
            }
        }
        else
        {
            $("#selCityList").emptySelect().append("<option value=''>-- 请选择城市 --</option>");
            $("#selCountiesList").emptySelect().append("<option value=''>-- 请选择区县 --</option>");
            $("#txtProvinceId").val("0"); 
            $("#txtCityId").val("0"); 
            $("#txtCountieId").val("0");
            $("#txtRegionId").val("0");
            $("#txtRegionInfo").val("");
        }
    }
    function LoadFunctionDataList()
	{
	    
	}
    </script>

</head>
<body>

    <script type="text/javascript">
    <!--
        function ___doPostBack(eventTarget) { 
            var theForm = document.forms["crmForm"];
            if (!theForm) {
                theForm = document.crmForm;
            }
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) { 
                theForm.___EVENTTARGET.value = eventTarget;
                theForm.submit();
            }
        }
    // -->
    </script>

    <div id="success" style="position: absolute; z-index: 300; height: 130px; width: 284px;
        left: 50%; top: 50%; margin-left: -150px; margin-top: -80px;">
        <div style="position: absolute; z-index: 300; width: 270px; height: 90px; background-color: #FFFFFF;
            border: solid #6699CC 1px; font-size: 14px;">
            <div style="height: 64px; line-height: 150%; padding: 0px 3px 0px 3px;" align="center">
                <br />
                <table>
                    <tr>
                        <td valign="top">
                            <img border="0" src="../_imgs/admin/progress.gif" />
                        </td>
                        <td valign="middle" style="font-size: 14px; width: 150px;">
                            操作执行中 ...<br />
                        </td>
                    </tr>
                </table>
                <br />
            </div>
        </div>
        <div style="position: absolute; width: 270px; height: 108px; z-index: 299; left: 4px;
            top: 5px; background-color: #E8E8E8; border: #E8E8E8 1px solid; display: none;">
        </div>
    </div>

    <script type="text/javascript">
        document.getElementById("success").style.display = "none"; 
    </script>

    <script src="../../admin/_static/_common/scripts/divcover.js" type="text/javascript"></script>

    <form id="crmForm" runat="server">
    <input type="hidden" name="___EVENTTARGET" id="___EVENTTARGET" value="" />
    <div class="divAreas">
        <div class="boxTopBar">
            <div class="boxTopBarLeft">
                <div class="navBar">
                    <uc1:ctlNavBar ID="ctlNavBar1" runat="server" />
                </div>
            </div>
            <div class="boxTopBarRight">
            </div>
        </div>
        <div class="boxMain">
            <div class="boxMainBody">
                <table cellpadding="0" cellspacing="0" class="stdTable" style="width: 98%;">
                    <tbody>
                        <tr style="height: 32px; background: #F0F0F0; padding-left: 10px; font-weight: bold;
                            text-align: left;">
                            <td>
                                编辑会员信息
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="padding: 5px 5px 5px;">
                                <div style="overflow-y: scroll; overflow-x: hidden; height: 320px; margin-left: auto;
                                    margin-right: auto; padding: 10px 20px 10px 20px; width: auto;">
                                    <table class="tbsToolsBar" cellpadding="0" cellspacing="0" align="center" style="width: auto;
                                        vertical-align: top;">
                                        <colgroup>
                                            <col style="width: 115px;" />
                                            <col />
                                            <col style="width: 115px; text-align: right;" />
                                            <col />
                                        </colgroup>
                                        <tbody>
                                            <tr>
                                                <td>
                                                    用户名：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtUsername" name="txtUsername" style="width: 150px;"
                                                        runat="server" required="required" controlname="用户名" isvalidator />
                                                </td>
                                                <td>
                                                    登录密码：
                                                </td>
                                                <td>
                                                    <input type="password" class="tbxReadOnly" id="txtPassword" name="txtPassword" runat="server"
                                                        style="width: 150px;" required="required" controlname="登录密码" isvalidator />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    昵称：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" style="width: 150px;" id="txtMobileAlias"
                                                        name="txtMobileAlias" runat="server" />
                                                </td>
                                                <td>
                                                    真实姓名：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" style="width: 150px;" id="txtFullName" name="txtFullName"
                                                        runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    性别：
                                                </td>
                                                <td>
                                                    <asp:RadioButtonList ID="rbtGenderList" runat="server" RepeatDirection="Horizontal"
                                                        CellPadding="0" CellSpacing="0">
                                                        <asp:ListItem Value="0" Text="男"></asp:ListItem>
                                                        <asp:ListItem Value="1" Text="女"></asp:ListItem>
                                                        <asp:ListItem Value="-1" Text="未知"></asp:ListItem>
                                                    </asp:RadioButtonList>
                                                </td>
                                                <td>
                                                    生日：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" style="width: 150px;" id="txtBirthday" name="txtBirthday"
                                                        onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'});" runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    E-Mail：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtEmail" name="txtEmail" runat="server"
                                                        style="width: 150px;" required="required" controlname="E-Mail" isvalidator datatype="email" />
                                                </td>
                                                <td>
                                                    联系电话：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtTel" name="txtTel" value="0" style="width: 150px;"
                                                        runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtMobile" name="txtMobile" runat="server"
                                                        style="width: 150px;" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    所属地区：
                                                </td>
                                                <td colspan="3">
                                                    <span style="float: left; margin: 0px 5px 0px 0px;">
                                                        <select id="selProvinceList" runat="server" class="SelectBox" style="width: auto;">
                                                        </select>
                                                    </span><span style="float: left; margin: 0px 5px;">
                                                        <select id="selCityList" name="selCityList" class="SelectBox" style="width: auto;">
                                                            <option value="">-- 选择城市 --</option>
                                                        </select>
                                                    </span><span style="float: left; margin: 0px 5px;">
                                                        <select id="selCountiesList" name="selCountiesList" class="SelectBox" style="width: auto;">
                                                            <option value="">-- 选择区县 --</option>
                                                        </select>
                                                    </span>
                                                    <input id="txtCountryId" runat="server" type="hidden" value="0" />
                                                    <input id="txtProvinceId" runat="server" type="hidden" value="0" />
                                                    <input id="txtCityId" runat="server" type="hidden" value="0" />
                                                    <input id="txtCountieId" runat="server" type="hidden" value="0" />
                                                    <input id="txtRegionId" runat="server" type="hidden" />
                                                    <input id="txtRegionInfo" runat="server" type="hidden" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    联系地址：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtAddress" name="txtAddress" runat="server" />
                                                </td>
                                                <td>
                                                    邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtZIP" name="txtZIP" runat="server" style="width: 150px;" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    审核状态：
                                                </td>
                                                <td>
                                                    <select id="selIsApproved" runat="server" class="SelectBox" style="width: 150px;"
                                                        required="required" controlname="审核状态" isvalidator>
                                                        <option value="">-- 请选择审核状态 --</option>
                                                        <option value="1" selected>已审核</option>
                                                        <option value="0">未审核</option>
                                                    </select>
                                                </td>
                                                <td>
                                                    帐号状态：
                                                </td>
                                                <td>
                                                    <select id="selIsLockedOut" runat="server" class="SelectBox" style="width: 150px;"
                                                        required="required" controlname="帐号状态" isvalidator>
                                                        <option value="">-- 请选择帐号状态 --</option>
                                                        <option value="1">锁定</option>
                                                        <option value="0" selected>活动</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="4" style="border-bottom: 1px solid #ccc; font-weight: bold;">
                                                    活动信息
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    注册时间：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtCreatedDate" name="txtCreatedDate"
                                                        value="" style="width: 150px;" runat="server" readonly />
                                                </td>
                                                <td>
                                                    最后一次登录时间：
                                                </td>
                                                <td>
                                                    <input type="text" class="tbxReadOnly" id="txtLastLoginDate" name="txtLastLoginDate"
                                                        value="" style="width: 150px;" runat="server" readonly />
                                                </td>
                                            </tr> 
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr style="height: 35px;">
                            <td class="WIN-Form-Bottom">
                                <input type="button" value="保存信息" id="btnSave" class="btn_s" onclick="if(validator.validatorAll()){this.disabled=true;success.style.display='block';HideOverSels('success');___doPostBack('save');}"
                                    style="width: 120px; height: 25px; margin: 0px 5px;" />
                                <input type="button" value="返回列表" id="btnCancel" class="btn_s" onclick="Cancel();"
                                    style="height: 25px; width: 120px; margin: 0px 5px;" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="boxBottomBar">
            <div class="boxBottomBarLeft">
                &nbsp;
            </div>
            <div class="boxBottomBarRight">
                &nbsp;
            </div>
        </div>
    </div>
    </form>
</body>
</html>
